﻿using Finance.Entity;
using Finance.Poco;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Finance.IDal
{
    public interface IUserDal
    {
        UserEntity GetUser(object providerUserKey, bool userIsOnline);

        bool ChangePassword(string username, string oldPasswordEnc, string newPasswordEnc);

        //bool CreateUser(string username, string passwordEnc, string email, string passwordQuestion, string passwordAnswer, bool isApproved);

        bool CreateUser(string username, string passwordEnc, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey,int orgId);

        bool ValidateUser(string username, string passwordEnc);

        string GetUserNameByEmail(string email);

        bool ResetPassword(string username, string answer, string newPasswordEnc);

        bool UnlockUser(string userName);

        void UpdateUser(UserEntity userEntity);

        bool DeleteUser(string username, bool deleteAllRelatedData);

        IEnumerable<ViewUserEntity> List(string userName, int pageIndex, int pageSize, out int total);

        bool ResetPassword(string userName, string passwordEnc);

        bool UpdateUser(int id, string realName, string email, int orgId);

        bool DeleteUser(int id);

        IEnumerable<ViewUserEntity> List(int orgId);
    }
}
